home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / dev / gcc / ixemul_src.lha / ixemul-41.0 / man / cat2 / getpriority.0 < prev    next >
Text File  |  1992-08-10  |  3KB  |  67 lines

  1.  
  2. GETPRIORITY(2)             UNIX Programmer's Manual             GETPRIORITY(2)
  3.  
  4. NNAAMMEE
  5.      ggeettpprriioorriittyy, sseettpprriioorriittyy - get/set program scheduling priority
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ##iinncclluuddee <<ssyyss//ttiimmee..hh>>
  9.      ##iinncclluuddee <<ssyyss//rreessoouurrccee..hh>>
  10.  
  11.      _i_n_t
  12.      ggeettpprriioorriittyy(_i_n_t _w_h_i_c_h, _i_n_t _w_h_o)
  13.  
  14.      _i_n_t
  15.      sseettpprriioorriittyy(_i_n_t _w_h_i_c_h, _i_n_t _w_h_o, _i_n_t _p_r_i_o)
  16.  
  17. DDEESSCCRRIIPPTTIIOONN
  18.      The scheduling priority of the process, process group, or user, as indi­
  19.      cated by _w_h_i_c_h and _w_h_o is obtained with the ggeettpprriioorriittyy() call and set
  20.      with the sseettpprriioorriittyy() call.  _W_h_i_c_h is one of PRIO_PROCESS, PRIO_PGRP, or
  21.      PRIO_USER, and _w_h_o is interpreted relative to _w_h_i_c_h (a process identifier
  22.      for PRIO_PROCESS, process group identifier for PRIO_PGRP, and a user ID
  23.      for PRIO_USER). A zero value of _w_h_o denotes the current process, process
  24.      group, or user.  _P_r_i_o is a value in the range ­20 to 20.  The default
  25.      priority is 0; lower priorities cause more favorable scheduling.
  26.  
  27.      The ggeettpprriioorriittyy() call returns the highest priority (lowest numerical
  28.      value) enjoyed by any of the specified processes.  The sseettpprriioorriittyy() call
  29.      sets the priorities of all of the specified processes to the specified
  30.      value.  Only the super­user may lower priorities.
  31.  
  32. RREETTUURRNN VVAALLUUEESS
  33.      Since ggeettpprriioorriittyy() can legitimately return the value ­1, it is necessary
  34.      to clear the external variable _e_r_r_n_o prior to the call, then check it af­
  35.      terward to determine if a ­1 is an error or a legitimate value.  The
  36.      sseettpprriioorriittyy() call returns 0 if there is no error, or ­1 if there is.
  37.  
  38. EERRRROORRSS
  39.      GGeettpprriioorriittyy() and sseettpprriioorriittyy() will fail if:
  40.  
  41.      [ESRCH]       No process was located using the _w_h_i_c_h and _w_h_o values spec­
  42.                    ified.
  43.  
  44.      [EINVAL]      _W_h_i_c_h was not one of PRIO_PROCESS, PRIO_PGRP, or PRIO_USER.
  45.  
  46.      In addition to the errors indicated above, sseettpprriioorriittyy() will fail if:
  47.  
  48.      [EPERM]       A process was located, but neither its effective nor real
  49.                    user ID matched the effective user ID of the caller.
  50.  
  51.      [EACCES]      A non super­user attempted to lower a process priority.
  52.  
  53. SSEEEE AALLSSOO
  54.      nice(1),  fork(2),  renice(8)
  55.  
  56. HHIISSTTOORRYY
  57.      The ggeettpprriioorriittyy function call appeared in 4.2BSD.
  58.  
  59. 4th Berkeley Distribution       March 10, 1991                               1
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.